First we need to import the 'physcon' module. If necessary this can be obtained from: http://www.hjcb.nl/python/physcon.html
In [1]:
import physcon as ps
In [2]:
ps.help()
In [3]:
ps.m_e
Out[3]:
We can also obtain the value for the speed of light in vacuo (c)
In [4]:
ps.c
Out[4]:
We can then work out the energy equivalence of an electron at rest:
In [5]:
energy = ps.m_e * ps.c * ps.c
and then divide by 1.6 x 10^16 to give an answer in keV:
In [6]:
energy/1.6e-16
Out[6]:
In [18]: